package com.example.expandablelistview.activity;

import java.io.File;

import android.app.Activity;
import android.content.ComponentName;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.util.Log;
import android.view.View;

import com.example.expandablelistview.R;

public class CallOther extends Activity {
	protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.callother);
    }
    
    public void mOnClick(View v){
        Intent intent = null;
        switch(v.getId()){
        case R.id.web:
            intent = new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.co.kr"));
            break;
        case R.id.dial:
            intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:010-1234-1234"));
            break;
        case R.id.picture:
            intent = new Intent(Intent.ACTION_VIEW);
            String sd = Environment.getExternalStorageDirectory().getAbsolutePath();
            Log.d("CallOther", "외부 저장 경로" + sd);
            Uri uri = Uri.fromFile(new File(sd+"/boss.jpg"));
            intent.setDataAndType(uri, "image/jpeg");
            break;
        case R.id.other:
            intent = new Intent(Intent.ACTION_MAIN);
            intent.setComponent(new ComponentName("exam.memo","exam.memo.Memo"));
//          intent.setClassName("exam.memo","exam.memo.Memo");
            break;
        }
        startActivity(intent);
    }

}
